% Copyright (C) 2014-19 Benjamin Born and Johannes Pfeifer 
%
% This is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation, either version 3 of the License, or
% (at your option) any later version.
%
% This code is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
% GNU General Public License for more details.
%
% For a copy of the licencse,
% see <http://www.gnu.org/licenses/>.

%% Table 1: G-descriptives

fid_g=fopen('Results/Descriptives_g.txt','w+');

topstring_descriptives_g={'\begin{table}[t!]'
'  \centering'
'  \caption{Basic properties of government consumption-to-GDP ratio}'
'   \tabcolsep=.2in'
'\def \arraystretch{.9}'
'    \begin{tabular}{lccrrrr}'
'    \toprule'
'    Country   & first obs & last obs & min & max & mean & std \\'
'    \midrule'};

for ii=1:size(topstring_descriptives_g,1)
fprintf(fid_g,'%-150s \n',topstring_descriptives_g{ii,1});
end


%% Table 2: spread-descriptives

fid_spread=fopen('Results/Descriptives_spread.txt','w+');

topstring_descriptives_spread={'\begin{table}[htbp]'
'  \centering'
'  \caption{Basic properties of sovereign default premia}'
'    \begin{tabular}{lcrrrrcc}'
'    \toprule'
'     Country   & Group &  min & max & mean & std & $\rho(\Delta y_t,s_t)$ & $\rho(\Delta g_t,s_t)$\\\\'
'   \midrule'};

for ii=1:size(topstring_descriptives_spread,1)
fprintf(fid_spread,'%-150s \n',topstring_descriptives_spread{ii,1});
end